home *** CD-ROM | disk | FTP | other *** search
/ Canadian Geographic Explorer / Canadian Geographic Explorer.iso / pc / riddler.dxr / 00027_Init Current Question.ls < prev    next >
Encoding:
Text File  |  1996-10-03  |  2.8 KB  |  72 lines

  1. on exitFrame
  2.   global gCurrQuestion, gAnimObj, gQAnimFirst, gQAnimLength, gVoiceChannel, gPathToSound, fileDelimiter, gCurrQString, gValue, gOrder, gCategory, gTextData, gTenQList, gScoreList, gValueSprite, gCatSprite, gNumOfQuestions, gWhoBuzzedIn
  3.   set gWhoBuzzedIn to 0
  4.   if not (the puppet of sprite gValueSprite) then
  5.     puppetSprite(gValueSprite, 1)
  6.   end if
  7.   set the memberNum of sprite gValueSprite to the number of member "Null Cast" of castLib "categories and point values"
  8.   if not (the puppet of sprite gCatSprite) then
  9.     puppetSprite(gCatSprite, 1)
  10.   end if
  11.   set the memberNum of sprite gCatSprite to the number of member "Null Cast" of castLib "categories and point values"
  12.   unloadMember()
  13.   set gCurrQuestion to gCurrQuestion + 1
  14.   if gCurrQuestion > gNumOfQuestions then
  15.     KillEmPuppets()
  16.     go("Winner Is")
  17.     exit
  18.   end if
  19.   set the text of field "player1 score" to string(getAt(gScoreList, 1))
  20.   set the text of field "player2 score" to string(getAt(gScoreList, 2))
  21.   set the text of field "player3 score" to string(getAt(gScoreList, 3))
  22.   set jStartFrame to getAt(gQAnimFirst, gCurrQuestion)
  23.   set jNumOfFrames to getAt(gQAnimLength, gCurrQuestion)
  24.   unloadMember()
  25.   preloadMember(member jStartFrame, member (the number of member jStartFrame + jNumOfFrames - 1))
  26.   init(gAnimObj, jStartFrame, jNumOfFrames, point(240, 60), 0)
  27.   sound playFile gVoiceChannel, gPathToSound & "qanda" & fileDelimiter & "qstn" & gCurrQuestion & "_1.aif"
  28.   set the actorList to []
  29.   add(the actorList, gAnimObj)
  30.   updateStage()
  31.   set jQuestion to getAt(gTenQList, gCurrQuestion)
  32.   set jLine to ((jQuestion - 1) * 7) + 1
  33.   set gCurrQString to addZeroes(jQuestion)
  34.   set jTempText to line jLine + 5 of gTextData
  35.   if the machineType = 256 then
  36.     put EMPTY into char 1 of jTempText
  37.   end if
  38.   set gCategory to integer(jTempText)
  39.   set gValue to random(5)
  40.   set the text of field "question text" to line jLine + 1 of gTextData
  41.   if the machineType = 256 then
  42.     put EMPTY into char 1 of field "question text"
  43.   end if
  44.   set jRandom to random(6)
  45.   case jRandom of
  46.     1:
  47.       set gOrder to [1, 2, 3]
  48.     2:
  49.       set gOrder to [1, 3, 2]
  50.     3:
  51.       set gOrder to [3, 1, 2]
  52.     4:
  53.       set gOrder to [2, 1, 3]
  54.     5:
  55.       set gOrder to [2, 3, 1]
  56.     otherwise:
  57.       set gOrder to [3, 2, 1]
  58.   end case
  59.   set the text of field "choice 1 text" to line jLine + 1 + getAt(gOrder, 1) of gTextData
  60.   if the machineType = 256 then
  61.     put EMPTY into char 1 of field "choice 1 text"
  62.   end if
  63.   set the text of field "choice 2 text" to line jLine + 1 + getAt(gOrder, 2) of gTextData
  64.   if the machineType = 256 then
  65.     put EMPTY into char 1 of field "choice 2 text"
  66.   end if
  67.   set the text of field "choice 3 text" to line jLine + 1 + getAt(gOrder, 3) of gTextData
  68.   if the machineType = 256 then
  69.     put EMPTY into char 1 of field "choice 3 text"
  70.   end if
  71. end
  72.